<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateMunicipioTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" styleClass="ajustaListaMensagemErro"  layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="list"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateMunicipioLabel_munCd}" for="munCd" />
                    <p:inputText id="munCd" value="#{municipioController.selected.munCd}" title="#{bundle.CreateMunicipioTitle_munCd}" required="true" requiredMessage="#{bundle.CreateMunicipioRequiredMessage_munCd}"/>
                    <h:outputLabel value="#{bundle.CreateMunicipioLabel_munCdIbge}" for="munCdIbge" />
                    <p:inputText id="munCdIbge" value="#{municipioController.selected.munCdIbge}" title="#{bundle.CreateMunicipioTitle_munCdIbge}" />
                    <h:outputLabel value="#{bundle.CreateMunicipioLabel_munNm}" for="munNm" />
                    <p:inputText id="munNm" value="#{municipioController.selected.munNm}" title="#{bundle.CreateMunicipioTitle_munNm}" />
                    <h:outputLabel value="#{bundle.CreateMunicipioLabel_munSg}" for="munSg" />
                    <p:inputText id="munSg" value="#{municipioController.selected.munSg}" title="#{bundle.CreateMunicipioTitle_munSg}" />
                    <h:outputLabel value="#{bundle.CreateMunicipioLabel_munArTotalKm2}" for="munArTotalKm2" />
                    <p:inputText id="munArTotalKm2" value="#{municipioController.selected.munArTotalKm2}" title="#{bundle.CreateMunicipioTitle_munArTotalKm2}" />
                    <h:outputLabel value="#{bundle.CreateMunicipioLabel_munQtPopulacao}" for="munQtPopulacao" />
                    <p:inputText id="munQtPopulacao" value="#{municipioController.selected.munQtPopulacao}" title="#{bundle.CreateMunicipioTitle_munQtPopulacao}" />
                    <h:outputLabel value="#{bundle.CreateMunicipioLabel_munGmPoligono}" for="munGmPoligono" />
                    <p:inputText id="munGmPoligono" value="#{municipioController.selected.munGmPoligono}" title="#{bundle.CreateMunicipioTitle_munGmPoligono}" />
                    <h:outputLabel value="#{bundle.CreateMunicipioLabel_munMicCd}" for="munMicCd" />
                    <p:inputText id="munMicCd" value="#{municipioController.selected.munMicCd}" title="#{bundle.CreateMunicipioTitle_munMicCd}" />
                    <h:outputLabel value="#{bundle.CreateMunicipioLabel_munArUrbanaKm2}" for="munArUrbanaKm2" />
                    <p:inputText id="munArUrbanaKm2" value="#{municipioController.selected.munArUrbanaKm2}" title="#{bundle.CreateMunicipioTitle_munArUrbanaKm2}" />
                    <h:outputLabel value="#{bundle.CreateMunicipioLabel_munArRuralKm2}" for="munArRuralKm2" />
                    <p:inputText id="munArRuralKm2" value="#{municipioController.selected.munArRuralKm2}" title="#{bundle.CreateMunicipioTitle_munArRuralKm2}" />
                    <h:outputLabel value="#{bundle.CreateMunicipioLabel_munDtEmancipacao}" for="munDtEmancipacao" />
                    <p:inputText id="munDtEmancipacao" value="#{municipioController.selected.munDtEmancipacao}" title="#{bundle.CreateMunicipioTitle_munDtEmancipacao}" >
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </p:inputText>
                    <h:outputLabel value="#{bundle.CreateMunicipioLabel_munAaReferencia}" for="munAaReferencia" />
                    <p:inputText id="munAaReferencia" value="#{municipioController.selected.munAaReferencia}" title="#{bundle.CreateMunicipioTitle_munAaReferencia}" />
                    <h:outputLabel value="#{bundle.CreateMunicipioLabel_munNmMunicipioOrigem}" for="munNmMunicipioOrigem" />
                    <p:inputText id="munNmMunicipioOrigem" value="#{municipioController.selected.munNmMunicipioOrigem}" title="#{bundle.CreateMunicipioTitle_munNmMunicipioOrigem}" />
                    <h:outputLabel value="#{bundle.CreateMunicipioLabel_ufdCd}" for="ufdCd" />
                    <h:selectOneMenu id="ufdCd" value="#{municipioController.selected.ufdCd}" title="#{bundle.CreateMunicipioTitle_ufdCd}" >
                        <f:selectItems value="#{unidadeFederacaoController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{municipioController.create}" value="#{bundle.CreateMunicipioSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{municipioController.prepareList}" value="#{bundle.CreateMunicipioShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.CreateMunicipioIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
